/*------------------------------------------------------------------------
//                          Project CommonLib                           //
------------------------------------------------------------------------*/

#pragma once

namespace Trace
{
    enum E_FLAG
    {
        eTRACE_DEFAULT=0,
        eTRACE_TIME=1,
    };

    #define SIZE_DEBUG_TRACE KB(1)
    #define SIZE_TRACE_TIME KB(1)

	void DebugOutputSingle(LPCWSTR locationString, E_FLAG flag, TCHAR *format, ... );
    void DebugOutput(LPCWSTR locationString, E_FLAG flag, TCHAR *format, ... );
}

#ifdef CmTRACE
#undef CmTRACE
#endif

// if using location, set #define TRACE_POS	MAKE_LOCATION
//#define TRACE_POS nullptr
#define TRACE_POS MAKE_LOCATION

#define CmTRACE(arg, ...)			Trace::DebugOutput(TRACE_POS, Trace::eTRACE_TIME, ##arg, __VA_ARGS__)
#define CmTRACE_JUST(arg, ...)		Trace::DebugOutput(TRACE_POS, Trace::eTRACE_DEFAULT, ##arg, __VA_ARGS__)
#define CmTRACE_ANSI(arg, ...)		Trace::DebugOutput(TRACE_POS, Trace::eTRACE_TIME, ##arg, __VA_ARGS__)
#define CmTRACE_JUST_ANSI(arg, ...) Trace::DebugOutput(TRACE_POS, Trace::eTRACE_DEFAULT, ##arg, __VA_ARGS__)
#define CmTRACE_SINGLE(arg, ...)	Trace::DebugOutputSingle(TRACE_POS, Trace::eTRACE_DEFAULT, ##arg, __VA_ARGS__)




/*------------------------------------------------------------------------

------------------------------------------------------------------------*/